/* 
 * File:   FiguraFactory.h
 * Author: mm021791
 *
 * Created on 26 de septiembre de 2012, 13:12
 */

#ifndef FIGURAFACTORY_H
#define	FIGURAFACTORY_H

#include <string>
#include <exception>

#include "Figura.h"
#include "Posicion.h"
#include "FiguraFactoryException.h"

using namespace std;

using namespace TP::Grafica;

namespace TP{ namespace Grafica { namespace Componentes { 
    
    class FiguraFactory {
        
        public:

            FiguraFactory();
            
            virtual ~FiguraFactory();
            
            Figura* crear(const string& pDescriptor) throw (FiguraFactoryException&);
            
        protected:

            char getTipo (const string& pDescriptor) throw (FiguraFactoryException&);
            
            string getRotacion(Posicion* pPosicion) throw (FiguraFactoryException&);            
            
            Posicion* getPosicion(const string& pDescriptor) throw (FiguraFactoryException&);
            
    private:
        void cargarTemplate (Figura* &pFigura, char pTipo, Posicion* pPosicion) throw (FiguraFactoryException&);
        
    };
}}}



#endif	/* FIGURAFACTORY_H */

